package com.adlx.dingdong.mall.user.api;

import com.adlx.dingdong.mall.user.api.hystrix.UserFeignClientHystrix;
import com.adlx.dingdong.mall.user.dto.UserDTO;
import com.adlx.dingdong.mall.user.dto.UserRegDTO;
import com.adlx.dingdong.mall.user.vo.UserVO;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by dulei on 18/1/8.
 */
@FeignClient(value = "user-service", fallback = UserFeignClientHystrix.class)
public interface UserFeignClient {

    @RequestMapping(method = RequestMethod.POST)
    UserDTO getByUsernameAndPasswordDTO(UserRegDTO userRegDTO);

    @RequestMapping(value = "/getUser/{username}", method = RequestMethod.GET)
    UserDTO getUserByUsername(@PathVariable("username") String username);


    @RequestMapping(value = "/{uid}", method = RequestMethod.GET)
    UserVO get(@PathVariable("uid") Long uid);

}
